<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<portlet:defineObjects />

<h1>Quản Lí Lớp</h1>


<portlet:actionURL var="editclassURL">
	<portlet:param name="action" value="editclass"/>
</portlet:actionURL>


<portlet:actionURL var="searchclassURL">
	<portlet:param name="action" value="searchclass"/>
</portlet:actionURL>

<portlet:renderURL var="listURL">
	<portlet:param name="action" value="list"/>
</portlet:renderURL>


<portlet:actionURL var="deleteclassURL">
	<portlet:param name="action" value="deleteclass"/>
</portlet:actionURL>

<portlet:renderURL var="addclassURL">
	<portlet:param name="action" value="addclass"/>
</portlet:renderURL>



<span><a href="${addclassURL}">Thêm Lớp</a></span>

<form action="${searchclassURL}" method="post">
	<select name='<portlet:namespace/>idFaculty'>
		<c:forEach items="${listFaculty}" var="e" >
			<option value="${e.idFaculty}" <c:if test="${e.idFaculty==idFacultySeleted}">selected="selected"</c:if>>${e.nameFaculty}</option>
		</c:forEach>
	</select>
	<input type="submit" value="Tìm Kiếm">
</form>

<c:if test="${not empty listClass}">
<table border="1">
	
	<thead>
		<td>Tên Lớp</td>
		<td>Edit</td>
		<td>Delete</td>
	</thead>
	<c:forEach items="${listClass}" var="e">
		<tr>
			<td>${e.nameClass}</td>
			<td><form action="${editclassURL}" method="post">
				<input type="hidden" name='<portlet:namespace/>idClass' value="${e.idClass}"/>
				<input type="submit" value="Edit"/>
			</form></td>
			<td><form action="${deleteclassURL}" method="post">
				<input type="hidden" name='<portlet:namespace/>idClass' value="${e.idClass}"/>
				<input type="submit" value="Delete"/>
			</form></td>
		</tr>
	</c:forEach>
	
</table>
</c:if>
<c:if test="${empty listClass}">
Không có môn học.
</c:if>
<br/>
<a href="${listURL}">Back</a>
